package com.trkj.pojo;

import java.io.Serializable;
import javax.persistence.*;

import com.alibaba.fastjson.annotation.JSONField;

import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.List;


/**
 * The persistent class for the SALARY database table.
 * 
 */
@Entity
@NamedQuery(name="Salary.findAll", query="SELECT s FROM Salary s")
public class Salary implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(name="SALARY_SALARYID_GENERATOR", sequenceName="HR")
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="SALARY_SALARYID_GENERATOR")
	@Column(name="SALARY_ID")
	private long salaryId;

	@Column(name="SALARY_NAME")
	private String salaryName;

	@Column(name="SALARY_NUMBER_EMPLOYEES")
	private BigDecimal salaryNumberEmployees;

	@Column(name="SALSRY_BEIZHU")
	private String salsryBeizhu;

	@Column(name="SALSRY_PERSON")
	private String salsryPerson;
	@JSONField(format="yyyy-MM-dd HH:mm:ss")
	@Column(name="SALSRY_PZDATE")
	private Timestamp salsryPzdate;
	@JSONField(format="yyyy-MM-dd HH:mm:ss")
	@Column(name="SALSRY_SHDATE")
	private Timestamp salsryShdate;

	@Column(name="SALSRY_SPZ")
	private String salsrySpz;

	@Column(name="SALSRY_STATE")
	private BigDecimal salsryState;

	@Column(name="SALSRY_SUM")
	private BigDecimal salsrySum;

	//bi-directional many-to-one association to ProjectShuju
	@OneToMany(mappedBy="salary")
	@JSONField(serialize=false)
	private List<ProjectShuju> projectShujus;

	//bi-directional many-to-one association to SalaryAccount
	@ManyToOne
	@JoinColumn(name="ACCOUNT_ID")
	private SalaryAccount salaryAccount;

	//bi-directional many-to-many association to StaffInformation
	@ManyToMany(mappedBy="salaries")
	@JSONField(serialize=false)
	private List<StaffInformation> staffInformations;

	public Salary() {
	}

	public long getSalaryId() {
		return this.salaryId;
	}

	public void setSalaryId(long salaryId) {
		this.salaryId = salaryId;
	}

	public String getSalaryName() {
		return this.salaryName;
	}

	public void setSalaryName(String salaryName) {
		this.salaryName = salaryName;
	}

	public BigDecimal getSalaryNumberEmployees() {
		return this.salaryNumberEmployees;
	}

	public void setSalaryNumberEmployees(BigDecimal salaryNumberEmployees) {
		this.salaryNumberEmployees = salaryNumberEmployees;
	}

	public String getSalsryBeizhu() {
		return this.salsryBeizhu;
	}

	public void setSalsryBeizhu(String salsryBeizhu) {
		this.salsryBeizhu = salsryBeizhu;
	}

	public String getSalsryPerson() {
		return this.salsryPerson;
	}

	public void setSalsryPerson(String salsryPerson) {
		this.salsryPerson = salsryPerson;
	}

	public Timestamp getSalsryPzdate() {
		return this.salsryPzdate;
	}

	public void setSalsryPzdate(Timestamp salsryPzdate) {
		this.salsryPzdate = salsryPzdate;
	}

	public Timestamp getSalsryShdate() {
		return this.salsryShdate;
	}

	public void setSalsryShdate(Timestamp salsryShdate) {
		this.salsryShdate = salsryShdate;
	}

	public String getSalsrySpz() {
		return this.salsrySpz;
	}

	public void setSalsrySpz(String salsrySpz) {
		this.salsrySpz = salsrySpz;
	}

	public BigDecimal getSalsryState() {
		return this.salsryState;
	}

	public void setSalsryState(BigDecimal salsryState) {
		this.salsryState = salsryState;
	}

	public BigDecimal getSalsrySum() {
		return this.salsrySum;
	}

	public void setSalsrySum(BigDecimal salsrySum) {
		this.salsrySum = salsrySum;
	}

	public List<ProjectShuju> getProjectShujus() {
		return this.projectShujus;
	}

	public void setProjectShujus(List<ProjectShuju> projectShujus) {
		this.projectShujus = projectShujus;
	}

	public ProjectShuju addProjectShujus(ProjectShuju projectShujus) {
		getProjectShujus().add(projectShujus);
		projectShujus.setSalary(this);

		return projectShujus;
	}

	public ProjectShuju removeProjectShujus(ProjectShuju projectShujus) {
		getProjectShujus().remove(projectShujus);
		projectShujus.setSalary(null);

		return projectShujus;
	}

	public SalaryAccount getSalaryAccount() {
		return this.salaryAccount;
	}

	public void setSalaryAccount(SalaryAccount salaryAccount) {
		this.salaryAccount = salaryAccount;
	}

	public List<StaffInformation> getStaffInformations() {
		return this.staffInformations;
	}

	public void setStaffInformations(List<StaffInformation> staffInformations) {
		this.staffInformations = staffInformations;
	}

}